<?php
/**
 * @file $HeadURL: job.php $
 * @author $Author: ZhangFan $
 * @date $Date: 2015-12-14 $
 * @brief
 */

namespace haibao\cms\data;
use \haibao\cms\business\Job as JobBusiness;
use \haibao\cms\business\JobCategory as JobCateBusiness;
class Job extends \haibao\cms\data\BaseMysql{
    public function __construct(){
        parent::__construct('\haibao\cms\model\data\Job');
    }
    public function changeJobStatusById($id,$status){
        $this->updateById($id, array(
                    \haibao\cms\model\filter\Job::CONDITION_FIELD_NAME_STATUS => $status
                ));
    }
    public function getJobCateStatus($id){
        $jobInfo = JobBusiness::getJobById($id);
        $cateId = $jobInfo->CateId;
        $jobCateInfo = JobCateBusiness::getModelById($cateId);
        $jobCateStatus = $jobCateInfo->Status;
        return $jobCateStatus;
    }
}